<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>我的-评论</title>
		<link rel="stylesheet" type="text/css" href="css/weui.css"/>
		<link rel="stylesheet" type="text/css" href="css/jquery-weui.css"/>
		<link rel="stylesheet" type="text/css" href="css/my_comment.css"/>
		<script type="text/javascript" src="js/rem.js"></script>
		<style type="text/css">
			[v-cloak] {
				display: none;
			}
		</style>
	</head>

	<body>
		<div id="app" v-cloak class="commentbox">
			<div class="comment">
				<div class="commenta">
					<div class="commenta_left">
						<img src="images/img1.png" />
					</div>
					<div class="commenta_right">
						<div class="commenta_right_title">龙湖甜品龙门店</div>
						<div class="commenta_right_label">
							<div :class="{crl_inner_cheak:item.state}" @click="selectWordBar(index)" v-for="(item,index) in items" class="crl_inner">{{item.name}}</div>
						</div>
					</div>
				</div>

				<div class="commentb">
					<textarea id='commentbValue' placeholder="亲，你觉得我们店如何呢？"></textarea>
				</div>
				<div class="commentc" @click="submitPay">
					提交
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="js/jquery-3.2.1.min.js" ></script>
	<script type="text/javascript" src="js/jquery-weui.min.js" ></script>
	<script type="text/javascript" src="js/vue2.5.16.js"></script>
	<script type="text/javascript">
		var app = new Vue({
			el: '#app',
			data: {
				items: [
					{
						name: '性价比高',
						state: false
					},
					{
						name: '味道鲜美',
						state: false
					},
					{
						name: '服务周到',
						state: false
					},
					{
						name: '环境优雅',
						state: false
					}
				]
			},
			methods: {
				//选择标签
				selectWordBar: function(index) {
					this.items[index].state = !this.items[index].state;
					console.log(this.items[index].state);
				},
				
				submitPay:function(){
					for (var i = 0; i < this.items.length; i++) {
						if(this.items[i].state!=false||$('#commentbValue').val().trim() != ''){
							var re = true;
							break;
						}
					}
					if(!re){
						$.toptip('请先评价',1500,'error');
					}else{
						$.toast("提交成功");
					}
				}
				
			}
		})
	</script>

</html>